package com.uuj.dome.service;

import com.uuj.dome.entity.UserEntity;
import com.uuj.dome.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ClassName:UserService
 * PACKAGE_NAME:com.uuj.dome.service
 */
@Service
@CacheConfig(cacheNames = "user")
public class UserService {

    @Autowired
    private UserRepository userRepository;


    @Cacheable
    public List<UserEntity> findAll() {
        return userRepository.findAll();
    }
}
